/**
 * 
 */
package com.easidea.tim.entity.saleorder;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.springside.core.dao.extend.Undeletable;

import com.easidea.tim.entity.BaseEntity;
import com.easidea.tim.entity.commodity.Product;

/**
 * 销售物品
 * @author Harrison
 *
 */

@Entity(name="tim_salesoder_order_item")
@org.hibernate.annotations.Entity(dynamicInsert=true,dynamicUpdate=true)
@Cache(region="tim_salesoder_order_item", usage=CacheConcurrencyStrategy.READ_WRITE)
@Undeletable(status="deleted")
public class SaleOrderItem extends BaseEntity{

	/**
	 * 
	 */
	private static final long serialVersionUID = -6740910741022051296L;
	
	private Product product;
	
	private String productName;
	
	private String productColor;
	
	private Double piNum;
	
	private Double moneyNum;
	
	private String meterNum;
	
	private String memo;

	private SaleOrder saleOrder;

	private Double totalMeter;
	
	private String meters;
	
	@Column(name="meters")
	public String getMeters() {
		return meters;
	}

	public void setMeters(String meters) {
		this.meters = meters;
	}
	
	@Column(name="totalMeter")
	public Double getTotalMeter() {
		return totalMeter;
	}

	public void setTotalMeter(Double totalMeter) {
		this.totalMeter = totalMeter;
	}
	
	@Column(name="meterNum", nullable=false,length=512)
	public String getMeterNum() {
		return meterNum;
	}

	public void setMeterNum(String meterNum) {
		this.meterNum = meterNum;
	}

	@Column(name="productName", nullable=false)
	public String getProductName() {
		return productName;
	}

	public void setProductName(String productName) {
		this.productName = productName;
	}

	@Column(name="productColor", nullable=false)
	public String getProductColor() {
		return productColor;
	}

	public void setProductColor(String productColor) {
		this.productColor = productColor;
	}

	@Column(name="piNum", nullable=false)
	public double getPiNum() {
		return piNum;
	}

	public void setPiNum(double piNum) {
		this.piNum = piNum;
	}

	@Column(name="moneyNum", nullable=false)
	public double getMoneyNum() {
		return moneyNum;
	}

	public void setMoneyNum(double moneyNum) {
		this.moneyNum = moneyNum;
	}
	
	@Column(name="memo")
	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	@ManyToOne(cascade=CascadeType.MERGE)
	@JoinColumn(name="saleorder_id")
	public SaleOrder getSaleOrder() {
		return saleOrder;
	}

	public void setSaleOrder(SaleOrder saleOrder) {
		this.saleOrder = saleOrder;
	}
	
	@ManyToOne(cascade=CascadeType.MERGE)
	@JoinColumn(name="product_id")
	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}
	
	
	
	
}
